//
//  CaculatorMaker.m
//  RACPrepareProject
//
//  Created by tianchao wu on 2017/7/10.
//  Copyright © 2017年 tianchao wu. All rights reserved.
//

#import "CaculatorMaker.h"

@implementation CaculatorMaker


-(CaculatorMaker *(^)(int))add
{
    return ^CaculatorMaker *(int value){
        _result += value;
        return self;
    };
}

-(CaculatorMaker *(^)(int))sub
{
    return ^CaculatorMaker *(int value){
        _result -= value;
        return self;
    };
}

-(CaculatorMaker *(^)(int))muilt
{
    return ^CaculatorMaker *(int value){
        _result *= value;
        return self;
    };
}

-(CaculatorMaker *(^)(int))divide
{
    return ^CaculatorMaker *(int value){
        if (value != 0) {
            _result = _result/value;
        }
        return self;
    };
}

@end
